Imports System.Windows.Forms
Imports dao
 Imports System.Data
Imports DTO
Public Class PHUHUYNHBus
Inherits AbstractBus
 Public Sub New()
 End Sub
 Public Sub New(ByVal ConnectionString As KetNoiDto)
 ketnoi = ConnectionString
 End Sub
 #Region "Xử Lý" 
 Public Sub Them(ByVal Dto As PHUHUYNHDto)
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.Them(Dto)
 End Sub
 Public Sub Xoa( ByVal IDPHUHUYNH As System.Int32)
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.xoa(IDPHUHUYNH)
 End Sub
 Public Sub sua(ByVal Dto As PHUHUYNHDto)
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.sua(Dto)
 End Sub
 #End Region 
 Public Function LayBangTable() As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 dao.laybang()
 Return Dao
 End Function
 Public Function LayBangTableIlist() As IList
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dim aList As New ArrayList 
 For i As Integer = 0 To Dao.Rows.Count - 1 
 Dim dtoPHUHUYNH As PHUHUYNHdto = LayBangDTo(i, Dao) 
 aList.Add(dtoPHUHUYNH)
 Next 
 Return aList 
 End Function
 Public Function LayBangTableSQL(ByVal sql As string) As DataTable
 Dim Dao As New  AbstractDao(sql,sql,ketnoi)
 Return Dao
 End Function
 Public Sub suaTEN_CHA( ByVal TEN_CHA as System.String, ByVal IDPHUHUYNH As System.Int32 )
 Dim dao As New PHUHUYNHDao(ketnoi)
 dao.suaTEN_CHA(TEN_CHA,IDPHUHUYNH)
 End Sub 
 Public Sub suaNGHENGHIEP_CHA( ByVal NGHENGHIEP_CHA as System.String, ByVal IDPHUHUYNH As System.Int32 )
 Dim dao As New PHUHUYNHDao(ketnoi)
 dao.suaNGHENGHIEP_CHA(NGHENGHIEP_CHA,IDPHUHUYNH)
 End Sub 
 Public Sub suaSDT_CHA( ByVal SDT_CHA as System.String, ByVal IDPHUHUYNH As System.Int32 )
 Dim dao As New PHUHUYNHDao(ketnoi)
 dao.suaSDT_CHA(SDT_CHA,IDPHUHUYNH)
 End Sub 
 Public Sub suaDIACHI_CHA( ByVal DIACHI_CHA as System.String, ByVal IDPHUHUYNH As System.Int32 )
 Dim dao As New PHUHUYNHDao(ketnoi)
 dao.suaDIACHI_CHA(DIACHI_CHA,IDPHUHUYNH)
 End Sub 
 Public Sub suaTEN_ME( ByVal TEN_ME as System.String, ByVal IDPHUHUYNH As System.Int32 )
 Dim dao As New PHUHUYNHDao(ketnoi)
 dao.suaTEN_ME(TEN_ME,IDPHUHUYNH)
 End Sub 
 Public Sub suaNGHENGHIEP_ME( ByVal NGHENGHIEP_ME as System.String, ByVal IDPHUHUYNH As System.Int32 )
 Dim dao As New PHUHUYNHDao(ketnoi)
 dao.suaNGHENGHIEP_ME(NGHENGHIEP_ME,IDPHUHUYNH)
 End Sub 
 Public Sub suaSDT_ME( ByVal SDT_ME as System.String, ByVal IDPHUHUYNH As System.Int32 )
 Dim dao As New PHUHUYNHDao(ketnoi)
 dao.suaSDT_ME(SDT_ME,IDPHUHUYNH)
 End Sub 
 Public Sub suaDIACHI_ME( ByVal DIACHI_ME as System.String, ByVal IDPHUHUYNH As System.Int32 )
 Dim dao As New PHUHUYNHDao(ketnoi)
 dao.suaDIACHI_ME(DIACHI_ME,IDPHUHUYNH)
 End Sub 
 Public Sub suaNGUOITHAN( ByVal NGUOITHAN as System.String, ByVal IDPHUHUYNH As System.Int32 )
 Dim dao As New PHUHUYNHDao(ketnoi)
 dao.suaNGUOITHAN(NGUOITHAN,IDPHUHUYNH)
 End Sub 
 Public Sub suaNGHENGHIE_PNGUOITHAN( ByVal NGHENGHIE_PNGUOITHAN as System.String, ByVal IDPHUHUYNH As System.Int32 )
 Dim dao As New PHUHUYNHDao(ketnoi)
 dao.suaNGHENGHIE_PNGUOITHAN(NGHENGHIE_PNGUOITHAN,IDPHUHUYNH)
 End Sub 
 Public Sub suaSDT_NGUOITHAN( ByVal SDT_NGUOITHAN as System.String, ByVal IDPHUHUYNH As System.Int32 )
 Dim dao As New PHUHUYNHDao(ketnoi)
 dao.suaSDT_NGUOITHAN(SDT_NGUOITHAN,IDPHUHUYNH)
 End Sub 
 Public Sub suaDIACHI_NGUOITHAN( ByVal DIACHI_NGUOITHAN as System.String, ByVal IDPHUHUYNH As System.Int32 )
 Dim dao As New PHUHUYNHDao(ketnoi)
 dao.suaDIACHI_NGUOITHAN(DIACHI_NGUOITHAN,IDPHUHUYNH)
 End Sub 
 Public Sub suaTRANGTHAI( ByVal TRANGTHAI as System.Int32, ByVal IDPHUHUYNH As System.Int32 )
 Dim dao As New PHUHUYNHDao(ketnoi)
 dao.suaTRANGTHAI(TRANGTHAI,IDPHUHUYNH)
 End Sub 
 Public Sub suaGHICHU( ByVal GHICHU as System.String, ByVal IDPHUHUYNH As System.Int32 )
 Dim dao As New PHUHUYNHDao(ketnoi)
 dao.suaGHICHU(GHICHU,IDPHUHUYNH)
 End Sub 
 Public Function LayBangTable( ByVal IDPHUHUYNH As System.Int32) As DataTable
 Dim Dao As New PHUHUYNHDao(IDPHUHUYNH,ketnoi)
 Return Dao
 End Function
 Public Function LayBangTableIlist( ByVal IDPHUHUYNH As System.Int32) As IList
 Dim Dao As New PHUHUYNHDao(IDPHUHUYNH,ketnoi)
 Dim aList As New ArrayList 
 For i As Integer = 0 To Dao.Rows.Count - 1 
 Dim dtoPHUHUYNH As PHUHUYNHdto = LayBangDTo(i, Dao) 
 aList.Add(dtoPHUHUYNH)
 Next 
 Return aList 
 End Function
 Public Function LayBangTableTheoIDPHUHUYNH (ByVal IDPHUHUYNH As System.Int32) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoIDPHUHUYNH(IDPHUHUYNH)
 Return Dao
 End Function
 Public Function LayBangTableTheoIDPHUHUYNH (ByVal ARRAY1 As ArrayList) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoIDPHUHUYNH(ARRAY1)
 Return Dao
 End Function
 Public sub XOAbangTableTheoIDPHUHUYNH (ByVal IDPHUHUYNH As System.Int32) 
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.XOABangTheoIDPHUHUYNH(IDPHUHUYNH)
 End sub
 Public Function LayBangTableTheoTEN_CHA (ByVal TEN_CHA As System.String) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoTEN_CHA(TEN_CHA)
 Return Dao
 End Function
 Public Function LayBangTableTheoTEN_CHA_like (ByVal TEN_CHA As System.String ) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoTEN_CHA_like (TEN_CHA)
 Return Dao
 End Function
 Public Function LayBangTableTheoTEN_CHA (ByVal ARRAY1 As ArrayList) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoTEN_CHA(ARRAY1)
 Return Dao
 End Function
 Public sub XOAbangTableTheoTEN_CHA (ByVal TEN_CHA As System.String) 
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.XOABangTheoTEN_CHA(TEN_CHA)
 End sub
 Public Function LayBangTableTheoNGHENGHIEP_CHA (ByVal NGHENGHIEP_CHA As System.String) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoNGHENGHIEP_CHA(NGHENGHIEP_CHA)
 Return Dao
 End Function
 Public Function LayBangTableTheoNGHENGHIEP_CHA_like (ByVal NGHENGHIEP_CHA As System.String ) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoNGHENGHIEP_CHA_like (NGHENGHIEP_CHA)
 Return Dao
 End Function
 Public Function LayBangTableTheoNGHENGHIEP_CHA (ByVal ARRAY1 As ArrayList) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoNGHENGHIEP_CHA(ARRAY1)
 Return Dao
 End Function
 Public sub XOAbangTableTheoNGHENGHIEP_CHA (ByVal NGHENGHIEP_CHA As System.String) 
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.XOABangTheoNGHENGHIEP_CHA(NGHENGHIEP_CHA)
 End sub
 Public Function LayBangTableTheoSDT_CHA (ByVal SDT_CHA As System.String) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoSDT_CHA(SDT_CHA)
 Return Dao
 End Function
 Public Function LayBangTableTheoSDT_CHA_like (ByVal SDT_CHA As System.String ) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoSDT_CHA_like (SDT_CHA)
 Return Dao
 End Function
 Public Function LayBangTableTheoSDT_CHA (ByVal ARRAY1 As ArrayList) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoSDT_CHA(ARRAY1)
 Return Dao
 End Function
 Public sub XOAbangTableTheoSDT_CHA (ByVal SDT_CHA As System.String) 
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.XOABangTheoSDT_CHA(SDT_CHA)
 End sub
 Public Function LayBangTableTheoDIACHI_CHA (ByVal DIACHI_CHA As System.String) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoDIACHI_CHA(DIACHI_CHA)
 Return Dao
 End Function
 Public Function LayBangTableTheoDIACHI_CHA_like (ByVal DIACHI_CHA As System.String ) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoDIACHI_CHA_like (DIACHI_CHA)
 Return Dao
 End Function
 Public Function LayBangTableTheoDIACHI_CHA (ByVal ARRAY1 As ArrayList) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoDIACHI_CHA(ARRAY1)
 Return Dao
 End Function
 Public sub XOAbangTableTheoDIACHI_CHA (ByVal DIACHI_CHA As System.String) 
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.XOABangTheoDIACHI_CHA(DIACHI_CHA)
 End sub
 Public Function LayBangTableTheoTEN_ME (ByVal TEN_ME As System.String) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoTEN_ME(TEN_ME)
 Return Dao
 End Function
 Public Function LayBangTableTheoTEN_ME_like (ByVal TEN_ME As System.String ) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoTEN_ME_like (TEN_ME)
 Return Dao
 End Function
 Public Function LayBangTableTheoTEN_ME (ByVal ARRAY1 As ArrayList) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoTEN_ME(ARRAY1)
 Return Dao
 End Function
 Public sub XOAbangTableTheoTEN_ME (ByVal TEN_ME As System.String) 
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.XOABangTheoTEN_ME(TEN_ME)
 End sub
 Public Function LayBangTableTheoNGHENGHIEP_ME (ByVal NGHENGHIEP_ME As System.String) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoNGHENGHIEP_ME(NGHENGHIEP_ME)
 Return Dao
 End Function
 Public Function LayBangTableTheoNGHENGHIEP_ME_like (ByVal NGHENGHIEP_ME As System.String ) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoNGHENGHIEP_ME_like (NGHENGHIEP_ME)
 Return Dao
 End Function
 Public Function LayBangTableTheoNGHENGHIEP_ME (ByVal ARRAY1 As ArrayList) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoNGHENGHIEP_ME(ARRAY1)
 Return Dao
 End Function
 Public sub XOAbangTableTheoNGHENGHIEP_ME (ByVal NGHENGHIEP_ME As System.String) 
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.XOABangTheoNGHENGHIEP_ME(NGHENGHIEP_ME)
 End sub
 Public Function LayBangTableTheoSDT_ME (ByVal SDT_ME As System.String) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoSDT_ME(SDT_ME)
 Return Dao
 End Function
 Public Function LayBangTableTheoSDT_ME_like (ByVal SDT_ME As System.String ) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoSDT_ME_like (SDT_ME)
 Return Dao
 End Function
 Public Function LayBangTableTheoSDT_ME (ByVal ARRAY1 As ArrayList) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoSDT_ME(ARRAY1)
 Return Dao
 End Function
 Public sub XOAbangTableTheoSDT_ME (ByVal SDT_ME As System.String) 
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.XOABangTheoSDT_ME(SDT_ME)
 End sub
 Public Function LayBangTableTheoDIACHI_ME (ByVal DIACHI_ME As System.String) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoDIACHI_ME(DIACHI_ME)
 Return Dao
 End Function
 Public Function LayBangTableTheoDIACHI_ME_like (ByVal DIACHI_ME As System.String ) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoDIACHI_ME_like (DIACHI_ME)
 Return Dao
 End Function
 Public Function LayBangTableTheoDIACHI_ME (ByVal ARRAY1 As ArrayList) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoDIACHI_ME(ARRAY1)
 Return Dao
 End Function
 Public sub XOAbangTableTheoDIACHI_ME (ByVal DIACHI_ME As System.String) 
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.XOABangTheoDIACHI_ME(DIACHI_ME)
 End sub
 Public Function LayBangTableTheoNGUOITHAN (ByVal NGUOITHAN As System.String) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoNGUOITHAN(NGUOITHAN)
 Return Dao
 End Function
 Public Function LayBangTableTheoNGUOITHAN_like (ByVal NGUOITHAN As System.String ) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoNGUOITHAN_like (NGUOITHAN)
 Return Dao
 End Function
 Public Function LayBangTableTheoNGUOITHAN (ByVal ARRAY1 As ArrayList) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoNGUOITHAN(ARRAY1)
 Return Dao
 End Function
 Public sub XOAbangTableTheoNGUOITHAN (ByVal NGUOITHAN As System.String) 
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.XOABangTheoNGUOITHAN(NGUOITHAN)
 End sub
 Public Function LayBangTableTheoNGHENGHIE_PNGUOITHAN (ByVal NGHENGHIE_PNGUOITHAN As System.String) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoNGHENGHIE_PNGUOITHAN(NGHENGHIE_PNGUOITHAN)
 Return Dao
 End Function
 Public Function LayBangTableTheoNGHENGHIE_PNGUOITHAN_like (ByVal NGHENGHIE_PNGUOITHAN As System.String ) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoNGHENGHIE_PNGUOITHAN_like (NGHENGHIE_PNGUOITHAN)
 Return Dao
 End Function
 Public Function LayBangTableTheoNGHENGHIE_PNGUOITHAN (ByVal ARRAY1 As ArrayList) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoNGHENGHIE_PNGUOITHAN(ARRAY1)
 Return Dao
 End Function
 Public sub XOAbangTableTheoNGHENGHIE_PNGUOITHAN (ByVal NGHENGHIE_PNGUOITHAN As System.String) 
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.XOABangTheoNGHENGHIE_PNGUOITHAN(NGHENGHIE_PNGUOITHAN)
 End sub
 Public Function LayBangTableTheoSDT_NGUOITHAN (ByVal SDT_NGUOITHAN As System.String) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoSDT_NGUOITHAN(SDT_NGUOITHAN)
 Return Dao
 End Function
 Public Function LayBangTableTheoSDT_NGUOITHAN_like (ByVal SDT_NGUOITHAN As System.String ) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoSDT_NGUOITHAN_like (SDT_NGUOITHAN)
 Return Dao
 End Function
 Public Function LayBangTableTheoSDT_NGUOITHAN (ByVal ARRAY1 As ArrayList) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoSDT_NGUOITHAN(ARRAY1)
 Return Dao
 End Function
 Public sub XOAbangTableTheoSDT_NGUOITHAN (ByVal SDT_NGUOITHAN As System.String) 
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.XOABangTheoSDT_NGUOITHAN(SDT_NGUOITHAN)
 End sub
 Public Function LayBangTableTheoDIACHI_NGUOITHAN (ByVal DIACHI_NGUOITHAN As System.String) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoDIACHI_NGUOITHAN(DIACHI_NGUOITHAN)
 Return Dao
 End Function
 Public Function LayBangTableTheoDIACHI_NGUOITHAN_like (ByVal DIACHI_NGUOITHAN As System.String ) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoDIACHI_NGUOITHAN_like (DIACHI_NGUOITHAN)
 Return Dao
 End Function
 Public Function LayBangTableTheoDIACHI_NGUOITHAN (ByVal ARRAY1 As ArrayList) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoDIACHI_NGUOITHAN(ARRAY1)
 Return Dao
 End Function
 Public sub XOAbangTableTheoDIACHI_NGUOITHAN (ByVal DIACHI_NGUOITHAN As System.String) 
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.XOABangTheoDIACHI_NGUOITHAN(DIACHI_NGUOITHAN)
 End sub
 Public Function LayBangTableTheoTRANGTHAI (ByVal TRANGTHAI As System.Int32) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoTRANGTHAI(TRANGTHAI)
 Return Dao
 End Function
 Public Function LayBangTableTheoTRANGTHAI (ByVal ARRAY1 As ArrayList) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoTRANGTHAI(ARRAY1)
 Return Dao
 End Function
 Public sub XOAbangTableTheoTRANGTHAI (ByVal TRANGTHAI As System.Int32) 
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.XOABangTheoTRANGTHAI(TRANGTHAI)
 End sub
 Public Function LayBangTableTheoGHICHU (ByVal GHICHU As System.String) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoGHICHU(GHICHU)
 Return Dao
 End Function
 Public Function LayBangTableTheoGHICHU_like (ByVal GHICHU As System.String ) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoGHICHU_like (GHICHU)
 Return Dao
 End Function
 Public Function LayBangTableTheoGHICHU (ByVal ARRAY1 As ArrayList) As DataTable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangTheoGHICHU(ARRAY1)
 Return Dao
 End Function
 Public sub XOAbangTableTheoGHICHU (ByVal GHICHU As System.String) 
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.XOABangTheoGHICHU(GHICHU)
 End sub
 Public Function LayBangDTo( ByVal IDPHUHUYNH As System.Int32) As PHUHUYNHdto
 Dim Dao As New PHUHUYNHDao(IDPHUHUYNH, ketnoi)
 Dim dto As New PHUHUYNHdto
 If Dao.Rows.Count<= 0 then Return dto
 Try
 If IsDBNull(Dao.Rows(0)("IDPHUHUYNH")) = False Then
 Dto.IDPHUHUYNH = Dao.Rows(0)("IDPHUHUYNH")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("PHUHUYNH.IDPHUHUYNH")) = False Then
 Dto.IDPHUHUYNH = Dao.Rows(0)("PHUHUYNH.IDPHUHUYNH")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("TEN_CHA")) = False Then
 Dto.TEN_CHA = Dao.Rows(0)("TEN_CHA")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("PHUHUYNH.TEN_CHA")) = False Then
 Dto.TEN_CHA = Dao.Rows(0)("PHUHUYNH.TEN_CHA")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("NGHENGHIEP_CHA")) = False Then
 Dto.NGHENGHIEP_CHA = Dao.Rows(0)("NGHENGHIEP_CHA")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("PHUHUYNH.NGHENGHIEP_CHA")) = False Then
 Dto.NGHENGHIEP_CHA = Dao.Rows(0)("PHUHUYNH.NGHENGHIEP_CHA")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("SDT_CHA")) = False Then
 Dto.SDT_CHA = Dao.Rows(0)("SDT_CHA")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("PHUHUYNH.SDT_CHA")) = False Then
 Dto.SDT_CHA = Dao.Rows(0)("PHUHUYNH.SDT_CHA")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("DIACHI_CHA")) = False Then
 Dto.DIACHI_CHA = Dao.Rows(0)("DIACHI_CHA")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("PHUHUYNH.DIACHI_CHA")) = False Then
 Dto.DIACHI_CHA = Dao.Rows(0)("PHUHUYNH.DIACHI_CHA")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("TEN_ME")) = False Then
 Dto.TEN_ME = Dao.Rows(0)("TEN_ME")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("PHUHUYNH.TEN_ME")) = False Then
 Dto.TEN_ME = Dao.Rows(0)("PHUHUYNH.TEN_ME")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("NGHENGHIEP_ME")) = False Then
 Dto.NGHENGHIEP_ME = Dao.Rows(0)("NGHENGHIEP_ME")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("PHUHUYNH.NGHENGHIEP_ME")) = False Then
 Dto.NGHENGHIEP_ME = Dao.Rows(0)("PHUHUYNH.NGHENGHIEP_ME")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("SDT_ME")) = False Then
 Dto.SDT_ME = Dao.Rows(0)("SDT_ME")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("PHUHUYNH.SDT_ME")) = False Then
 Dto.SDT_ME = Dao.Rows(0)("PHUHUYNH.SDT_ME")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("DIACHI_ME")) = False Then
 Dto.DIACHI_ME = Dao.Rows(0)("DIACHI_ME")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("PHUHUYNH.DIACHI_ME")) = False Then
 Dto.DIACHI_ME = Dao.Rows(0)("PHUHUYNH.DIACHI_ME")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("NGUOITHAN")) = False Then
 Dto.NGUOITHAN = Dao.Rows(0)("NGUOITHAN")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("PHUHUYNH.NGUOITHAN")) = False Then
 Dto.NGUOITHAN = Dao.Rows(0)("PHUHUYNH.NGUOITHAN")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("NGHENGHIE_PNGUOITHAN")) = False Then
 Dto.NGHENGHIE_PNGUOITHAN = Dao.Rows(0)("NGHENGHIE_PNGUOITHAN")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("PHUHUYNH.NGHENGHIE_PNGUOITHAN")) = False Then
 Dto.NGHENGHIE_PNGUOITHAN = Dao.Rows(0)("PHUHUYNH.NGHENGHIE_PNGUOITHAN")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("SDT_NGUOITHAN")) = False Then
 Dto.SDT_NGUOITHAN = Dao.Rows(0)("SDT_NGUOITHAN")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("PHUHUYNH.SDT_NGUOITHAN")) = False Then
 Dto.SDT_NGUOITHAN = Dao.Rows(0)("PHUHUYNH.SDT_NGUOITHAN")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("DIACHI_NGUOITHAN")) = False Then
 Dto.DIACHI_NGUOITHAN = Dao.Rows(0)("DIACHI_NGUOITHAN")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("PHUHUYNH.DIACHI_NGUOITHAN")) = False Then
 Dto.DIACHI_NGUOITHAN = Dao.Rows(0)("PHUHUYNH.DIACHI_NGUOITHAN")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("TRANGTHAI")) = False Then
 Dto.TRANGTHAI = Dao.Rows(0)("TRANGTHAI")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("PHUHUYNH.TRANGTHAI")) = False Then
 Dto.TRANGTHAI = Dao.Rows(0)("PHUHUYNH.TRANGTHAI")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("GHICHU")) = False Then
 Dto.GHICHU = Dao.Rows(0)("GHICHU")
 End if
Catch ex As Exception
End Try
 Try
 If IsDBNull(Dao.Rows(0)("PHUHUYNH.GHICHU")) = False Then
 Dto.GHICHU = Dao.Rows(0)("PHUHUYNH.GHICHU")
 End if
Catch ex As Exception
End Try
 Return dto
 end function
 Public Function LayBangDTo(ByVal i As Integer, ByVal dao As DataTable) As PHUHUYNHdto
 Dim dto As New PHUHUYNHdto
 If Dao.Rows.Count<=0 then Return dto
 Try
 If IsDBNull(Dao.Rows(i)("IDPHUHUYNH")) = False Then
 Dto.IDPHUHUYNH = Dao.Rows(i)("IDPHUHUYNH")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("PHUHUYNH.IDPHUHUYNH")) = False Then
 Dto.IDPHUHUYNH = Dao.Rows(i)("PHUHUYNH.IDPHUHUYNH")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("TEN_CHA")) = False Then
 Dto.TEN_CHA = Dao.Rows(i)("TEN_CHA")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("PHUHUYNH.TEN_CHA")) = False Then
 Dto.TEN_CHA = Dao.Rows(i)("PHUHUYNH.TEN_CHA")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("NGHENGHIEP_CHA")) = False Then
 Dto.NGHENGHIEP_CHA = Dao.Rows(i)("NGHENGHIEP_CHA")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("PHUHUYNH.NGHENGHIEP_CHA")) = False Then
 Dto.NGHENGHIEP_CHA = Dao.Rows(i)("PHUHUYNH.NGHENGHIEP_CHA")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("SDT_CHA")) = False Then
 Dto.SDT_CHA = Dao.Rows(i)("SDT_CHA")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("PHUHUYNH.SDT_CHA")) = False Then
 Dto.SDT_CHA = Dao.Rows(i)("PHUHUYNH.SDT_CHA")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("DIACHI_CHA")) = False Then
 Dto.DIACHI_CHA = Dao.Rows(i)("DIACHI_CHA")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("PHUHUYNH.DIACHI_CHA")) = False Then
 Dto.DIACHI_CHA = Dao.Rows(i)("PHUHUYNH.DIACHI_CHA")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("TEN_ME")) = False Then
 Dto.TEN_ME = Dao.Rows(i)("TEN_ME")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("PHUHUYNH.TEN_ME")) = False Then
 Dto.TEN_ME = Dao.Rows(i)("PHUHUYNH.TEN_ME")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("NGHENGHIEP_ME")) = False Then
 Dto.NGHENGHIEP_ME = Dao.Rows(i)("NGHENGHIEP_ME")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("PHUHUYNH.NGHENGHIEP_ME")) = False Then
 Dto.NGHENGHIEP_ME = Dao.Rows(i)("PHUHUYNH.NGHENGHIEP_ME")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("SDT_ME")) = False Then
 Dto.SDT_ME = Dao.Rows(i)("SDT_ME")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("PHUHUYNH.SDT_ME")) = False Then
 Dto.SDT_ME = Dao.Rows(i)("PHUHUYNH.SDT_ME")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("DIACHI_ME")) = False Then
 Dto.DIACHI_ME = Dao.Rows(i)("DIACHI_ME")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("PHUHUYNH.DIACHI_ME")) = False Then
 Dto.DIACHI_ME = Dao.Rows(i)("PHUHUYNH.DIACHI_ME")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("PHUHUYNH.NGUOITHAN")) = False Then
 Try
 Dto.NGUOITHAN = Dao.Rows(i)("PHUHUYNH_NGUOITHAN")
 Catch ex As Exception
 End Try
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("NGUOITHAN")) = False Then
 Dto.NGUOITHAN = Dao.Rows(i)("NGUOITHAN")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("PHUHUYNH.NGUOITHAN")) = False Then
 Dto.NGUOITHAN = Dao.Rows(i)("PHUHUYNH.NGUOITHAN")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("NGHENGHIE_PNGUOITHAN")) = False Then
 Dto.NGHENGHIE_PNGUOITHAN = Dao.Rows(i)("NGHENGHIE_PNGUOITHAN")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("PHUHUYNH.NGHENGHIE_PNGUOITHAN")) = False Then
 Dto.NGHENGHIE_PNGUOITHAN = Dao.Rows(i)("PHUHUYNH.NGHENGHIE_PNGUOITHAN")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("SDT_NGUOITHAN")) = False Then
 Dto.SDT_NGUOITHAN = Dao.Rows(i)("SDT_NGUOITHAN")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("PHUHUYNH.SDT_NGUOITHAN")) = False Then
 Dto.SDT_NGUOITHAN = Dao.Rows(i)("PHUHUYNH.SDT_NGUOITHAN")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("DIACHI_NGUOITHAN")) = False Then
 Dto.DIACHI_NGUOITHAN = Dao.Rows(i)("DIACHI_NGUOITHAN")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("PHUHUYNH.DIACHI_NGUOITHAN")) = False Then
 Dto.DIACHI_NGUOITHAN = Dao.Rows(i)("PHUHUYNH.DIACHI_NGUOITHAN")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("TRANGTHAI")) = False Then
 Dto.TRANGTHAI = Dao.Rows(i)("TRANGTHAI")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("PHUHUYNH.TRANGTHAI")) = False Then
 Dto.TRANGTHAI = Dao.Rows(i)("PHUHUYNH.TRANGTHAI")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("GHICHU")) = False Then
 Dto.GHICHU = Dao.Rows(i)("GHICHU")
 End if
 Catch ex As Exception
 End Try
 Try
 If IsDBNull(Dao.Rows(i)("PHUHUYNH.GHICHU")) = False Then
 Dto.GHICHU = Dao.Rows(i)("PHUHUYNH.GHICHU")
 End if
 Catch ex As Exception
 End Try
 Return dto
 end function
 Public Function LayBangDTo(ByVal dong As Integer, ByVal dao As DataGridView) As PHUHUYNHdto
 Dim dto As New PHUHUYNHdto
 If dao.Rows.Count <= 0 Then Return dto
 For cot As Integer = 0 To dao.Columns.Count - 1
 Try
 Dto.HoTro(dao.Columns(cot).DataPropertyName, dao.Item(cot, dong).Value)
 Catch ex As Exception
 End Try
 Next
 Return Dto
 End Function
 Public Function layBangNhieuTable() as Datatable
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.layBangNhieuTable()
 Return Dao
 End Function
 Public Sub Taotable()
 Dim Dao As New PHUHUYNHDao(ketnoi)
 Dao.TaoTable()
 End Sub
 End Class

